Skip to content

fix(blueprints): make system flows validate on Kestra 2.0 - #247

Draft
Ben8t wants to merge 1 commit into
mainfrom
fix/system-flows
Draft

fix(blueprints): make system flows validate on Kestra 2.0#247
Ben8t wants to merge 1 commit into
mainfrom
fix/system-flows

Conversation

@Ben8t

@Ben8t Ben8t commented Jun 10, 2026

Copy link
Copy Markdown
Member

Fixes #246

What

Validated all 22 system namespace blueprints against a Kestra EE v2.0.0-rc1 instance and fixed every validation error. After this change, all 22 flows validate (kestractl flows validate) and deploy (kestractl flows deploy) cleanly — verified on a live 2.0.0-rc1 instance.

Changes

Fix Flows
Flow trigger conditionsstates failure-alert-discord, failure-alert-email, failure-alert-gmail, failure-alert-sentry-1, failure-alert-slack, failure-alert-teams, failure-alert-zenduty
Flow trigger conditions (ExecutionStatus + ExecutionNamespace prefix) → states + `when: "{{ flow.namespace \ startsWith('company') }}"` (canonical v2 example pattern)
Remove forced from pluginDefaults (removed in 2.0) copy-flows-to-new-tenant, k8s-namespace-logs-and-events
io.kestra.plugin.core.flow.ForEachio.kestra.plugin.core.flow.Loop k8s-namespace-logs-and-events
expiredOnlybehavior: {type: key, expiredOnly: true} on PurgeKV kv-store-purge
Secret-annotated properties now use {{ secret('...') }} instead of plain-text placeholders (fixes v2 validation warnings) push-to-git, sync-from-git, failure-alert-email, create-hubspot-ticket-on-failure, create-linear-issue-on-failure

Remaining warnings (intentional)

The 7 unscoped failure-alert blueprints still emit "This flow will be triggered for EVERY execution of EVERY flow on your instance" — that is the documented purpose of those blueprints (instance-wide alerting in one place), so behavior was kept and the warning is informational.

Validation evidence

22 flow(s) valid, 0 failed        # kestractl flows validate (extend block stripped)
22 flow(s) deployed successfully, 0 failed   # kestractl flows deploy --namespace system --override

Note: the extend: block is blueprint-index metadata and is rejected by the server API — it was stripped before validate/deploy, as the blueprint indexer does.

⚠️ See the note in #246 about a possible core runtime issue with the canonical when: "{{ flow.namespace | startsWith(...) }}" pattern on the Flow trigger.

Validated all 22 system-namespace blueprints against Kestra EE v2.0.0-rc1
and fixed every validation error:

- Replace removed Flow trigger 'conditions' with 'states' (and 'when'
  namespace scoping where the blueprint previously used
  ExecutionNamespace with prefix matching)
- Remove 'forced' from pluginDefaults (field removed from
  FlowPluginDefault in 2.0)
- Replace removed 'expiredOnly' property on PurgeKV with the new
  'behavior' object
- Replace removed io.kestra.plugin.core.flow.ForEach with
  io.kestra.plugin.core.flow.Loop
- Use secret() expressions for secret-annotated properties (username,
  apiKey, token) that triggered plain-text secret validation warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System flow blueprints fail validation on Kestra 2.0 (removed trigger conditions, forced pluginDefaults, expiredOnly, ForEach)

1 participant